package com.zx.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zx.dao.UserDao;
import com.zx.entity.Page;
import com.zx.entity.User;
import com.zx.service.UserService;
import com.zx.utils.MyBatiesUtils;

import java.util.List;

public class UserServiceImpl implements UserService {
    public PageInfo<User> queryUsers(Page page) {
        UserDao mapper = MyBatiesUtils.getMapper(UserDao.class);
        PageHelper.startPage(page.getPageNum(), page.getPageSize());
        List<User> users = mapper.queryUserList();
        return new PageInfo<User>(users);
    }
}
